var testapi = "http://test.api.malatoday.com/";
var url = "vote/search";
Vue.component('vote-item', {
    props: ['item'],
    template: '<li><div class="collapsible-header"><i class="material-icons blue-text">add</i>{{ item.name }}<a :href="item.id" class="secondary-content itemcontent"><span class="badge blue white-text">查看</span></a></div><div class="collapsible-body"><span>{{ item.description }}</span></div></li>'
});
var voteList = new Vue({
    el: '#voteList',
    data: {
        voteList: []
    }
});
$.get(testapi + url, function (data) {
    voteList.voteList = data.list;
    $('.preloader-wrapper').removeClass('active');
    $('.card-content').animate({
        opacity: '1'
    },function(){
    $('.itemcontent').attr("href",'page?id='+$('.itemcontent').attr("href"));

    });
    $('.collapsible').collapsible({
        onOpen: function (el) {
            el.find('i').text('remove');
            el.find('i').removeClass('blue-text');
        },
        onClose: function (el) {
            el.find('i').text('add');
            el.find('i').addClass('blue-text');
        }
    });
});

